package com.fuershiye.woman.monitor.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.fuershiye.woman.monitor.beans.IdNamePid;
import com.fuershiye.woman.monitor.dao.DepartmentTypeDao;
import com.fuershiye.woman.monitor.model.DepartmentType;
import com.fuershiye.woman.monitor.service.DepartmentTypeService;

@Service("departmentTypeService")
public class DepartmentTypeServiceImpl implements DepartmentTypeService {

	@Autowired
	private DepartmentTypeDao itDao;

	@Override
	public void save(DepartmentType it) {
		itDao.save(it);
	}

	@Override
	public void delete(Long id) {
		itDao.delete(id);
	}

	@Override
	public DepartmentType get(Long id) {
		return itDao.get(id);
	}

	/**
	 * 取当前表中最大数据
	 * 
	 * @return
	 */
	@Override
	public DepartmentType getTop() {
		return itDao.getTop();
	}

	/**
	 * @param id
	 *            sort(当前位置)
	 * @param aim
	 *            方向 (1:比id大的; 2:比id小的)
	 * @param count
	 *            取几条数据
	 * @return
	 */
	@Override
	public DepartmentType findBySort(Long sort, Integer aim, Integer count) {
		return itDao.findBySort(sort,aim,count);
	}

	@Override
	public DepartmentType findByCode(String code) {
		return itDao.findByCode(code);
	}

	@Override
	public List<DepartmentType> list(String name) {
		return itDao.list(name);
	}

	@Override
	public List<IdNamePid> getAllNames() {
		return itDao.getAllNames();
	}

}
